package com.example.common.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.blankj.utilcode.util.ToastUtils

/**
 * 基础Activity,没有实际业务
 */
abstract class BaseActivity<VDB:ViewDataBinding>:AppCompatActivity() {
    lateinit var mDataBinding:VDB
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mDataBinding=DataBindingUtil.setContentView(this,getLayoutId())
        initViews()
    }
    fun showToastMsg(msg:String){
        if (!msg.isNullOrEmpty()){
            ToastUtils.showLong(msg)
        }
    }
    abstract fun getLayoutId():Int
    abstract fun initViews()
}